package de.androidDevelopers.communityTeacherApp.models;

import android.database.sqlite.SQLiteDatabase;

import java.util.Map;

import de.greenrobot.dao.AbstractDao;
import de.greenrobot.dao.AbstractDaoSession;
import de.greenrobot.dao.identityscope.IdentityScopeType;
import de.greenrobot.dao.internal.DaoConfig;

import de.androidDevelopers.communityTeacherApp.models.ClassInfo;
import de.androidDevelopers.communityTeacherApp.models.RoomInfo;
import de.androidDevelopers.communityTeacherApp.models.ContactInfo;
import de.androidDevelopers.communityTeacherApp.models.PupilInfo;
import de.androidDevelopers.communityTeacherApp.models.SubjectInfo;
import de.androidDevelopers.communityTeacherApp.models.HomeworkInfo;
import de.androidDevelopers.communityTeacherApp.models.Classbook;
import de.androidDevelopers.communityTeacherApp.models.Grade;

import de.androidDevelopers.communityTeacherApp.models.ClassInfoDao;
import de.androidDevelopers.communityTeacherApp.models.RoomInfoDao;
import de.androidDevelopers.communityTeacherApp.models.ContactInfoDao;
import de.androidDevelopers.communityTeacherApp.models.PupilInfoDao;
import de.androidDevelopers.communityTeacherApp.models.SubjectInfoDao;
import de.androidDevelopers.communityTeacherApp.models.HomeworkInfoDao;
import de.androidDevelopers.communityTeacherApp.models.ClassbookDao;
import de.androidDevelopers.communityTeacherApp.models.GradeDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see de.greenrobot.dao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig classInfoDaoConfig;
    private final DaoConfig roomInfoDaoConfig;
    private final DaoConfig contactInfoDaoConfig;
    private final DaoConfig pupilInfoDaoConfig;
    private final DaoConfig subjectInfoDaoConfig;
    private final DaoConfig homeworkInfoDaoConfig;
    private final DaoConfig classbookDaoConfig;
    private final DaoConfig gradeDaoConfig;

    private final ClassInfoDao classInfoDao;
    private final RoomInfoDao roomInfoDao;
    private final ContactInfoDao contactInfoDao;
    private final PupilInfoDao pupilInfoDao;
    private final SubjectInfoDao subjectInfoDao;
    private final HomeworkInfoDao homeworkInfoDao;
    private final ClassbookDao classbookDao;
    private final GradeDao gradeDao;

    public DaoSession(SQLiteDatabase db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        classInfoDaoConfig = daoConfigMap.get(ClassInfoDao.class).clone();
        classInfoDaoConfig.initIdentityScope(type);

        roomInfoDaoConfig = daoConfigMap.get(RoomInfoDao.class).clone();
        roomInfoDaoConfig.initIdentityScope(type);

        contactInfoDaoConfig = daoConfigMap.get(ContactInfoDao.class).clone();
        contactInfoDaoConfig.initIdentityScope(type);

        pupilInfoDaoConfig = daoConfigMap.get(PupilInfoDao.class).clone();
        pupilInfoDaoConfig.initIdentityScope(type);

        subjectInfoDaoConfig = daoConfigMap.get(SubjectInfoDao.class).clone();
        subjectInfoDaoConfig.initIdentityScope(type);

        homeworkInfoDaoConfig = daoConfigMap.get(HomeworkInfoDao.class).clone();
        homeworkInfoDaoConfig.initIdentityScope(type);

        classbookDaoConfig = daoConfigMap.get(ClassbookDao.class).clone();
        classbookDaoConfig.initIdentityScope(type);

        gradeDaoConfig = daoConfigMap.get(GradeDao.class).clone();
        gradeDaoConfig.initIdentityScope(type);

        classInfoDao = new ClassInfoDao(classInfoDaoConfig, this);
        roomInfoDao = new RoomInfoDao(roomInfoDaoConfig, this);
        contactInfoDao = new ContactInfoDao(contactInfoDaoConfig, this);
        pupilInfoDao = new PupilInfoDao(pupilInfoDaoConfig, this);
        subjectInfoDao = new SubjectInfoDao(subjectInfoDaoConfig, this);
        homeworkInfoDao = new HomeworkInfoDao(homeworkInfoDaoConfig, this);
        classbookDao = new ClassbookDao(classbookDaoConfig, this);
        gradeDao = new GradeDao(gradeDaoConfig, this);

        registerDao(ClassInfo.class, classInfoDao);
        registerDao(RoomInfo.class, roomInfoDao);
        registerDao(ContactInfo.class, contactInfoDao);
        registerDao(PupilInfo.class, pupilInfoDao);
        registerDao(SubjectInfo.class, subjectInfoDao);
        registerDao(HomeworkInfo.class, homeworkInfoDao);
        registerDao(Classbook.class, classbookDao);
        registerDao(Grade.class, gradeDao);
    }
    
    public void clear() {
        classInfoDaoConfig.getIdentityScope().clear();
        roomInfoDaoConfig.getIdentityScope().clear();
        contactInfoDaoConfig.getIdentityScope().clear();
        pupilInfoDaoConfig.getIdentityScope().clear();
        subjectInfoDaoConfig.getIdentityScope().clear();
        homeworkInfoDaoConfig.getIdentityScope().clear();
        classbookDaoConfig.getIdentityScope().clear();
        gradeDaoConfig.getIdentityScope().clear();
    }

    public ClassInfoDao getClassInfoDao() {
        return classInfoDao;
    }

    public RoomInfoDao getRoomInfoDao() {
        return roomInfoDao;
    }

    public ContactInfoDao getContactInfoDao() {
        return contactInfoDao;
    }

    public PupilInfoDao getPupilInfoDao() {
        return pupilInfoDao;
    }

    public SubjectInfoDao getSubjectInfoDao() {
        return subjectInfoDao;
    }

    public HomeworkInfoDao getHomeworkInfoDao() {
        return homeworkInfoDao;
    }

    public ClassbookDao getClassbookDao() {
        return classbookDao;
    }

    public GradeDao getGradeDao() {
        return gradeDao;
    }

}
